// sqlMap.js  sql语句
const sqlMap = {
  Stu: {
    add: 'insert into today_cs(cs_id, channel) values (?, ?)',
    show: 'select * from today_cs',
    showlist: 'select * from today_cs where id = ?',
    del: 'delete from today_cs where id = ?',
    update: 'update today_cs set cs_id = ?,channel = ? where id = ?'
  },
  Detail: {
    add: "insert into today_detail(title, time, src, category, pic, url, weburl, content, cs_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)",
    show: 'select * from today_detail where cs_id = ?',
    showAll: 'select * from today_detail',
    showlist: 'select * from today_detail where id = ?',
 

    showsearch:'select * from today_detail where title like ?',
    del: 'delete from today_detail where id = ?',
    update: 'update today_detail set title = ?, time = ?, src = ?, category = ?, pic = ?, url = ?, weburl = ?, content = ?, cs_id = ? where id = ?'
  },
  UserInfo:{
    add: "insert into today_userInfo(username, password,jurisdiction,user_url) values (?, ?, ?,?)",
    show: 'select * from today_userInfo where username = ? and password = ?',
    showall: 'select * from today_userInfo',
    del: 'delete from today_userInfo where id = ?',
    update: 'update today_userInfo set username = ?, password = ?,jurisdiction = ?, user_name = ?, user_title = ?,  user_url = ? where id = ?'
  },
  Message:{
    add: "insert into today_userInfo(username, password) values (?, ?)",
    show: 'select * from today_message'
    // del: 'delete from today_detail where id = ?',
    // update: 'update today_detail set title = ?, time = ?, src = ?, category = ?, pic = ?, url = ?, weburl = ?, content = ?, cs_id = ? where id = ?'
  },
  User: {
    add: "insert into today_detail(title, time, src, category, pic, url, weburl, content, cs_id) values (?, ?, ?, ?, ?, ?, ?, ?, ?)",
    show: 'select * from today_ge where cs_id = ?',
    showAll: 'select * from today_detail',
    del: 'delete from today_detail where id = ?',
    update: 'update today_detail set title = ?, time = ?, src = ?, category = ?, pic = ?, url = ?, weburl = ?, content = ?, cs_id = ? where id = ?'
  },
  System:{
    // add: "insert into today_userInfo(username, password) values (?, ?)",
    showAll: 'select * from today_infos'
    // del: 'delete from today_detail where id = ?',
    // update: 'update today_detail set title = ?, time = ?, src = ?, category = ?, pic = ?, url = ?, weburl = ?, content = ?, cs_id = ? where id = ?'
  },
  List:{
    add: "insert into today_list(title, ass, comment, time, imgurl, url) values (?, ?, ?, ?, ?, ?)",
    showAll: 'select * from today_list',
    del: 'delete from today_list where id = ?',
    update: 'update today_list set title = ?, ass = ?, comment = ?, time = ?, imgurl = ?, url = ? where id = ?'
  }
}

module.exports = sqlMap